<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name=viewport
          content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
    <meta name="referrer" content="no-referrer">
    <title>⚠️注意身体⚠️</title>
    <style type="text/css">
        html, body {
            width: 100%;
            height: 100%;
            margin: auto;
            overflow: scroll: hidden;
        }

        .cn {
            position: fixed; /* 设置fixed固定定位 */
            bottom: 30px; /* 距离浏览器窗口下边框20px */
            left: 8px; /* 距离浏览器窗口右边框20px */
            z-index:999;
        }

        .cn a {
            display: block; /* 将<a>标签设为块元素，用于美化样式 */
            text-decoration: none; /* 取消超链接下画线 */
            color: #333; /* 设置文本颜色 */
            background-color: #f2f2f2; /* 设置背景颜色 */
            border: 1px solid #ccc; /* 设置边框样式 */
            padding: 10px 20px; /* 设置内边距 */
            border-radius: 10px; /* 设置圆角矩形 */
            letter-spacing: 2px; /* 设置文字间距 */
            font-size: 15px;
        }

        .jp {
            position: fixed; /* 设置fixed固定定位 */
            bottom: 30px; /* 距离浏览器窗口下边框20px */
            right: 8px; /* 距离浏览器窗口右边框20px */
            z-index:999;
        }

        .jp a {
            display: block; /* 将<a>标签设为块元素，用于美化样式 */
            text-decoration: none; /* 取消超链接下画线 */
            color: #333; /* 设置文本颜色 */
            background-color: #f2f2f2; /* 设置背景颜色 */
            border: 1px solid #ccc; /* 设置边框样式 */
            padding: 10px 20px; /* 设置内边距 */
            border-radius: 10px; /* 设置圆角矩形 */
            letter-spacing: 2px; /* 设置文字间距 */
            font-size: 15px;
        }

    </style>
</head>
<body>
<div style="background: #000; color: #FFF">
    <div th:each="video: ${videoList}">
        <a style="display:inline-block; width:100%; text-align:center" th:text="${video.getTitle()}"></a>
        <div th:id="${video.getId()}"></div>
    </div>
</div>
<div class="cn">
    <a th:href="'/gkd/60' + ${url}">国产<br>口味</a>
</div>

<div class="jp">
    <a th:href="'/gkd/110' + ${url}">日产<br>口味</a>
</div>

<script src="https://unpkg.byted-static.com/xgplayer/2.31.6/browser/index.js" charset="utf-8"></script>
<script src="https://unpkg.byted-static.com/xgplayer-hls.js/2.2.2/browser/index.js" charset="utf-8"></script>
<script th:each="video: ${videoList}">
    let [[${"hlsJsPlayer" + video.getId()}]] = new HlsJsPlayer({
        "id": "[[${video.getId()}]]",
        "playsinline": true,
        "whitelist": [
            ""
        ],
        "url": "[[${video.getVideoUrl()}]]",
        "autoplay": false,
        "fluid": true,
        "enableVideoDbltouch": true,
        "poster": "[[${video.getVideoImage()}]]",
        "fitVideoSize": "auto"
    });
    // [[${"hlsJsPlayer" + video.getId()}]].on('play', function () {
    //     [[${"hlsJsPlayer" + video.getId()}]].getFullscreen([[${"hlsJsPlayer" + video.getId()}]].root)
    // });
    [[${"hlsJsPlayer" + video.getId()}]].on('pause', function () {
        [[${"hlsJsPlayer" + video.getId()}]].exitFullscreen([[${"hlsJsPlayer" + video.getId()}]].root)
    });
</script>
</body>
</html>
